package cn.wusifx.zabbix.request.builder.service;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/service/create
 */
public class ServiceCreateRequestBuilder extends CreateRequestBuilder {
    private String name;
    private Integer algorithm;
    private Integer showSla;
    private Integer sortOrder;
    public ServiceCreateRequestBuilder(String auth) {
        super("service.create", auth);
    }

    public ServiceCreateRequestBuilder(Long id, String auth) {
        super("service.create", id, auth);
    }

    public String getName() {
        return name;
    }

    public ServiceCreateRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public Integer getAlgorithm() {
        return algorithm;
    }

    public ServiceCreateRequestBuilder setAlgorithm(Integer algorithm) {
        this.algorithm = algorithm;
        return this;
    }

    public Integer getShowSla() {
        return showSla;
    }

    public ServiceCreateRequestBuilder setShowSla(Integer showSla) {
        this.showSla = showSla;
        return this;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public ServiceCreateRequestBuilder setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("name",name);
        baseRequest.getParams().put("algorithm",algorithm);
        baseRequest.getParams().put("showsla",showSla);
        baseRequest.getParams().put("sortorder",sortOrder);
        return baseRequest;
    }
}
